<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>我的购物车</title>
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/cart.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    	function deleteItem(id){
    	var  b = window.confirm("确定要删除吗？");
           if(b){
				window.location.href="${pageContext.request.contextPath}/shop!shop.action?method=remove&cid="+id;           
           }
    	}
    
    </script>
</head>
<body>
<div id="top">
<div class="logo"><img src="images/logo.gif" /></div>
<div class="tmenu">
<span><a href="index!shows.action">首页</a></span><span >|</span>
<span><a href="userm.jsp">用户中心</a></span><span > |</span>
</div>


<div id="main">
	<div  class="cart"><img src="images/cart.gif" /></div>
	<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" style="overflow:hidden;">
  <tr>
    <td class="tableTitle">订单编号</td>
    <td class="tableTitle">商品名称</td>
    <td class="tableTitle">商品价格</td>
    <td class="tableTitle">商品数量</td>
    <td class="tableTitle">小计</td>
    <td class="tableTitle">操作</td>
  </tr>

<c:if test="${listcart!= null}">
	<c:forEach var="card" items="${listcart}" varStatus="cardtype">
  <tr>
    <td class="tableCell">${card.cardtype.id}</td>
    <td class="tableCell">${card.cardtype.cardTypeName}</td>
    <td class="tableCell">${card.cardtype.cardPrice}</td>
    <td class="tableCell">
	  	<a href="shop!shop.action?method=add&cid=${card.cardtype.id}">+</a>
	  	${card.count}
	  	<a href="shop!shop.action?method=sub&cid=${card.cardtype.id}">-</a>
   	</td>
    <td class="tableCell">${card.count *card.cardtype.cardPrice}</td>
    <td class="tableCell"><a href="javascript:deleteItem(${card.cardtype.id})" >删除</a></td>
  </tr>
</c:forEach>
</c:if>
<c:if test="${listcart==null}">
	<tr>
		<td colspan="6" align="center" style="color:red;">购物车没有任何商品！</td>
	</tr>
</c:if>
  
</table>
<div class="cartFun1">
<span>商品总金额:￥：${talprice}元</span>
<span>商品总数量: ${count} 个</span>
<input  type="button"  value="" class="checkout" onclick="window.location.href='shopping!Balance.action'"/>
<input type="button" value=""  class="continue" onclick="window.location.href='index!shows.action'"/>
</div>

</div>


<div style="clear:both"></div>
<div id="footer">
	<div  class="bmenu">
		<a href="#">免责条款</a>|<a href="#">隐私保护</a>|<a href="#">咨询热点</a>|<a href="#">联系我们</a>|<a href="#">公司简介</a>|<a href="#">批发方案</a>|<a href="#">配送方式</a>
	</div>
</div>
</body>
</html>
